1. Field of the Invention
The present invention relates to a digital camera that can enlarge an image and an image processing method for enlarging an image.
2. Description of the Related Art
Recently, the development of personal computers has contributed to the wide spread of digital still cameras that record digital image data obtained using an image pick-up element, in a memory card in place of a silver film.
FIG. 1 shows the configuration of a circuit in a digital still camera of this kind. When one image is picked up (single image pick-up), the illustrated circuit basically compresses YUV data (luminance and color difference data) before expanding one frame of the YUV data on a buffer memory.
An optical image obtained using an optical system 11 is formed as an image on a CCD 12 used as an image pick-up element. The CCD 12 includes, for example, an RGB color filter of Bayer type. Color image data obtained (hereinafter referred to as “Bayer data”) is sequentially sampled and held by a sample and hold circuit (S/H) 13, subsequently digitized by an A/D converter 14, and then supplied to a line processing unit 15.
The line processing unit 15 integrates the sequentially transmitted Bayer data into line data. A first transfer unit 16 transfers the Bayer data, integrated into the line data, to a memory 17, where the data is expanded and stored.
Once a predetermined number of lines of Bayer data are expanded on the memory 17, these data are read in block units and transferred to a Bayer/YUV converting unit 19 by a second transfer unit 18A.
The Bayer/YUV converting unit 19 executes an interpolating process or a color space process to convert the Bayer data (RGB data) into the YUV data, luminance and color difference color image. Then, the data thus obtained are supplied to a JPEG processing unit 21 via a switch (SW) 20. On the other hand, a third transfer unit 23 transfers these data to the memory 7 via a switch 22. Then, the data is expanded and stored in the memory 7.
The YUV data stored in the memory 17 are transferred to a display control unit 25 by a fourth transfer unit 24. Then, the display control unit 25 generates and outputs an analog video output signal and a signal for display on a liquid crystal monitor.
The JPEG processing unit 21 executes a data compression process such as an ADCT (Adaptive Discrete Cosine Transform) process or Huffman encoding process to the YUV data transferred by the Bayer/YUV converting unit 19 via the switch 20. Thus, JPEG data of a drastically reduced amount is obtained. A fifth transfer unit 26 transfers the JPEG data thus obtained to the memory 17, where the data is expanded and stored.
The JPEG data expanded and stored in the memory 17 is recorded in a memory card as a storage medium.
On the other hand, in a reproduction mode, JPEG data read from the memory card is stored in the memory 17 and then read and transferred to the JPEG processing unit 21 by a sixth transfer unit 27. Then, the JPEG processing unit 21 converts the JPEG data to the original YUV data, and the third transfer unit 23 transfers this YUV data via the switch 22 to the memory 17 for storage. Subsequently, the data is delivered to the display control unit 25 by the fourth transfer unit 24.
The above described circuit operations are totally controlled by a system controller 28 including a CPU. The operation of the system controller 28 is controlled in response to key operation signals input from a key input unit 29 including a shutter key and a mode key.
Now, a specific process for generating the YUV data will be described in detail.
Bayer data obtained by the line processing unit 15 and expanded and stored in the memory 17 is illustrated in FIG. 2A.
If it is assumed that it is necessary to refer a pixel configuration of 5×5 pixels of the Bayer data (FIG. 2A) as shown in FIG. 2B in order to generate one pixel of the YUV data by the Bayer/YUV converting unit 19, the YUV data as shown in FIG. 2C is generated.
It is assumed that the YUV data generated is transferred and output in the order shown in FIG. 3 and comprises blocks each having a vertical size of four pixels. Then, the pixels of the original Bayer data are read in the order as shown in FIG. 4. That is, for the first block with the range of lines C1 to C8, the pixels are read in the following order:
(C1, 1)→(C1, 2)→(C1, 3)→(C1, 4)→(C1, 5)→(C1, 6)→(C1, 7)→(C1, 8)→(C2, 1)→(C2, 2)→ . . .
For the second block the starting line of which is shifted downward by four lines and which has the range of lines C5 to C12:
(C1, 5)→(C1, 6)→(C1, 7)→(C1, 8)→(Cl, 9)→(C1, 10)→(C1, 11)→(C1, 12)→(C2, 5)→(C2, 6)→ . . .
Compared to the Bayer data read in this pixel position order, the pixels of the YUV data is transferred in the following order. For the first block:
(C3, 3)→(C3, 4)→(C3, 5)→(C3, 6)→(C4, 3)→(C4, 4)→(C4, 5)→(C4, 6)→(CS, 3)→(CS, 4)→ . . .
For the second block:
(C3, 7)→(C3, 8)→(C3, 9)→(C3, 10)→(C4, 7)→(C4, 8)→(C4, 9)→(C4, 10)→(CS, 7)→(C5, 8)→ . . .
FIG. 5A shows the configuration of pixels obtained when the YUV data is generated from Bayer data as described above. In the Bayer data in FIG. 5A, the hatched pixel shows a pixel used in generating the YUV data but which does not directly generate the corresponding YUV data.
In a Bayer data block read from the memory 17 and comprising eight lines, upper four lines are also read in the upper adjacent block. Thus, the YUV data generated in correspondence with these lines is configured not to contain any duplicate lines.
FIG. 5B illustrates the relationship between a Bayer data block read from a Bayer data frame and a YUV data block generated from the Bayer data block.
As described above, when the YUV data is generated from the Bayer data, the minimum required YUV data is generated, as shown in FIG. 5A.
Accordingly, the vertical size of the YUV data block is set at 8 if the required data is 4:2:2 (Y:Cb:Cr), and is set at 16 if the required data is 4:2:0. Then, the JPEG processing unit 21, which subsequently compresses the data, executes the process on every block comprising 8×8 pixels. Consequently, the YUV data can be transferred directly to the JPEG processing unit 21.
Here, with the circuit configuration shown in FIG. 1, in order to increase the speed of an electronic zooming process (enlarging process) in which the image data obtained through image pick-up is interpolated to increase the number of pixels constituting the image, it is assumed that a circuit that executes a pixel number conversion using hardware is provided succeeding to the Bayer/YUV converting unit 19, for example, between the switch 22 and the third transfer unit 23, instead of executing the enlarging process after expanding and storing one frame of YUV data on the memory 17. On these assumptions, since only the minimum required YUV data is transferred as described above, the interpolating process fails to generate pixels located between the pixels on the lowermost line of a YUV data block and the pixels on the uppermost line of the next YUV data block.
Thus, on the assumption that the same pixels as those on the lowermost line of the YUV data block are added as a line immediately below the lowermost line or that the pixels on lowermost line of the YUV data block are overlapped with the line immediately below the lowermost line, the pixel number converting circuit must execute an interpolating process (enlarging process) using these duplicate pixels. As a result, disadvantageously, the image is more markedly degraded as the enlargement ratio for electronic zooming increases in the vertical direction.
Further, it is assumed that the pixel number converting circuit executes an electronic zooming process (enlarging process) on each YUV data block. Then, since each YUV data block contains the same number of lines, it contains the same number of lines even after the enlarging process (interpolating process). Thus, disadvantageously, the available enlargement ratio (enlargement ratio) is limited.
Furthermore, if the pixel number converting circuit is to execute an electronic zooming process (enlarging process) on YUV data blocks and the YUV data block generated by the Bayer/YUV converting process is transferred directly to the JPEG processing unit 21, the YUV data, which has not undergone any electronic zooming process, is compressed and stored in the memory card. To avoid this, it is necessary to store the YUV data already subjected to an electronic zooming process in the memory 17 and transferring the read data to the JPEG processing unit 21. Consequently, much time is required to record the image.